package com.example.demo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;


// 使用excludeFilters注解来排除不加载的配置类，其他的需要排除雷同
@SpringBootApplication
//@ComponentScan(basePackages = {
//        "com.example.demo.config",
//        "com.example.demo.controller",
//        "com.example.demo.mapper",
//        "com.example.demo.utils",
//        "com.example.demo.services",
//        "com.example.demo.repository"
//}, excludeFilters = {
//        @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = com.example.demo.config.RabbitMQConfig.class)
//})
@ComponentScan(basePackages = {
        "com.example.demo.config",
        "com.example.demo.controller",
        "com.example.demo.mapper",
        "com.example.demo.utils",
        "com.example.demo.services",
        "com.example.demo.repository"
})
@MapperScan("com.example.demo.mapper")
@EnableAsync        // 启用异步支持（完成异步操作）
@EnableScheduling       // 定时任务支持
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

}
